<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>注册</title>
        <meta name="keywords" content="{$common.keywords}" />
		<meta name="description" content="{$common.description}" />
		<!-- Set render engine for 360 browser -->
		<meta name="renderer" content="webkit">
		<!-- No Baidu Siteapp-->
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<!-- Add to homescreen for Chrome on Android -->
		<meta name="mobile-web-app-capable" content="yes">
		<!-- Add to homescreen for Safari on iOS -->
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--#include file="resources.html"-->
		<!--鼠标经过导航跳动开始-->
		<!--<script type="text/javascript">
			$(function(){
				 $(".am-topbar-nav li").each(function(k,a){
					new JumpObj(a,5);//晃动幅度
					$(a).hover(function(){this.parentNode.parentNode.addClass("hover")});
				});
		 	}); 
		
		</script>-->
		<!--鼠标经过导航跳动结束-->
		<style type="text/css">
			.am-tabs-default .am-tabs-nav > .am-active a {
			    background-color: #FFFFFF;
			    color: #343740;
			}
			.am-tabs-default .am-tabs-nav a {
			    color: #6c6e7b;
			    line-height: 42px;
			    background: #FFFFFF;
			    font-weight: bold;
			    font-size: 1.3em;
			}
			.am-tabs-bd {
			    -moz-border-bottom-colors: none;
			    -moz-border-left-colors: none;
			    -moz-border-right-colors: none;
			    -moz-border-top-colors: none;
			    border-color: #FFFFFF;
			    border-image: none;
			    border-style: none;
			    border-width: medium 1px 1px;
			    overflow: hidden;
			    position: relative;
			    transition: height 0.3s ease 0s;
			    z-index: 100;
			}
			.am-tabs-bd .am-tab-panel {
			    float: left;
			    padding: 10px 0 15px;
			    position: absolute;
			    top: 0;
			    transform: translateX(-100%);
			    transition: transform 0.3s ease 0s;
			    visibility: hidden;
			    width: 100%;
			    z-index: 99;
			}
		</style>
		<script type="text/javascript">
            //注册信息表单验证开始
            $(function(){
                var validate=$("#myform_phone").validate({
                    rules:{
                        phoneuser:{
                            required:true,
                            isMobile:true,
                            isPhone:true
                        },
                        phoneyzm:{
                            required:true
                        },
                        phonepsd:{
                            required:true,
                            minlength:6,
                            maxlength:12
                        }
                    },
                    messages:{
                        phoneuser:{
                            isMobile:"请输入手机号码！",
                            isPhone:"请输入手机号码！"
                        },
                        phoneread:"请选择！"
                    },
                    errorPlacement: function(error, element) {
                        if ( element.is(":radio") )
                            error.appendTo ( element.parent() );
                        else if ( element.is(":checkbox") )
                            error.appendTo ( element.parent().parent() );
                        else if ( element.is("input[id=phoneyzm]") )
                            error.appendTo ( element.parent() );
                        else if ( element.is("input[id=emailyzm]") )
                            error.appendTo ( element.parent() );
                        else
                            error.insertAfter(element);
                    },
                })
                var validate2=$("#myform_email").validate({
                    rules:{
                    	nickname:{
                            required:true,
                        },
                        emailuser:{
                            required:true,
                            email:true
                        },
                        emailyzm:{
                            required:true
                        },
                        pas:{
                            required:true,
                            minlength:6,
                            maxlength:12
                        }

                    },
                    messages:{
                        emailuser:{
                            email:"请输入正确的邮箱！"
                        },
                        emailread:"请选择！"
                    },
                    errorPlacement: function(error, element) {
                        if ( element.is(":radio") )
                            error.appendTo ( element.parent() );
                        else if ( element.is(":checkbox") )
                            error.appendTo ( element.parent().parent() );
                        else if ( element.is("input[id=phoneyzm]") )
                            error.appendTo ( element.parent() );
                        else if ( element.is("input[id=emailyzm]") )
                            error.appendTo ( element.parent() );
                        else
                            error.insertAfter(element);
                    },
                })
            })
            //注册信息表单验证结束
		</script>
	</head>

	<body>
		<!--#include file="head.html"-->
		<!--内容开始-->
		<div class="container">
			<div class="sm_container">
				<div data-am-widget="tabs" class="am-tabs am-tabs-default">
					<ul class="am-tabs-nav am-cf" style="background: #FFFFFF;">
						<li class="">
							<a href="[data-tab-panel-0]">邮箱注册</a>
						</li>
					</ul>
						<div  class="am-tab-panel ">
							<form id="myform_email" class="am-form" action="__APP__/user/reg_save" method="post">
								<div class="am-form-group form_margin">
					        		<input name="nickname" id="nickname" type="text" onchange="checkConfirm()" class="am-form-field form_input" placeholder="昵称"/>
					        	</div>
					        	<div class="am-form-group form_margin">
					        		<input name="emailuser" id="emailuser" type="text" onchange="checkConfirm()" class="am-form-field form_input" placeholder="邮箱"/>
									<label id="isexist" for="emailuser" style="display: none;color:red">您输入的邮箱存在！请重新输入！</label>
					        	</div>
					        	<div class="am-form-group form_margin">
					        		<input name="pas" id="pas" type="password" class="am-form-field form_input" placeholder="设置6~12位密码"/>
									<input type="hidden" name="pass" id="pass"/>
					        	</div>
					        	<div class="am-form-group form_margin">
					        		<input name="emailyzm" id="emailyzm" type="text" class="am-form-field form_input" placeholder="验证码" style="width: 50%; float: left;"/>
					        		<div class="am-form-field btn_yzm2" style="width: 50%; float: left;">
					        			<div class="am-u-sm-6" style="padding: 0; text-align: center;">
					        				<img src="__PUBLIC__/assets/i/yzm_pic.jpg" class="yzm_pic"/>
					        			</div>
					        			<div class="am-u-sm-6" style="padding: 0; text-align: center;">
					        				<a href="javascript:;" class="yzm_change">换一换</a>
					        			</div>
					        		</div>
					        	</div>
					        	<div class="am-form-group form_margin content">
						        	<label class="login_check">
										<input type="checkbox" name="emailread" class="required" checked="checked"> &nbsp;&nbsp;我已阅读并接	受
						        	</label>
							        <a href="javascript:;" class="forget_btn">《使用协议》</a>
								</div>
								<div class="am-form-group form_margin">
					        		<input type="submit" class="am-form-field btn_login" onclick="return sha()" value="注册"/>
					        	</div>
					        	<div class="am-form-group form_margin">
					        		<p style="color: #6c6e7b;">
					        			已有账号?请 <span class="loginhere" data-am-modal="{target: '#login'}">在此登录</span>
					        		</p>
					        	</div>
					        </form>
						</div>
					</div>
				</div>
			</div>
		</div>
        <script type="text/ecmascript" src="__PUBLIC__/assets/js/sha1.js"></script>
        <script>
            function sha(){
                var v=hex_sha1($("#pas").val());
                $("#pass").val(v);
                $("#pas").attr("disabled", "true");
                return true;
            };

			document.getElementById("emailuser").onchange = function() {
				var request = new XMLHttpRequest();
				request.open("GET", "__APP__/user/email_exist?email=" + document.getElementById("emailuser").value);
				request.send();
				request.onreadystatechange = function() {
					if (request.readyState===4) {
						if (request.status===200) {
							//document.getElementById("isexist").innerHTML = request.responseText;
							if(request.responseText=="1"){
								document.getElementById("isexist").style.display="block";
							}
							else {
								document.getElementById("isexist").style.display="none";
							}

						} else {
							alert("发生错误：" + request.status);
						}
					}
				}
			}
        </script>

		<!--内容结束-->
		<!--#include file="foot.html"-->
	</body>

</html>